<!DOCTYPE html>
<html>
<head>
    <title>简单API测试</title>
</head>
<body>
    <h1>API测试页面</h1>
    <div id="result"></div>
    
    <script>
        console.log('开始测试...');
        
        fetch('http://localhost:19000/api/dashboard')
            .then(response => {
                console.log('响应状态:', response.status);
                document.getElementById('result').innerHTML = 
                    `<p>API调用成功! 状态: ${response.status}</p>`;
                return response.json();
            })
            .then(data => {
                console.log('数据:', data);
                document.getElementById('result').innerHTML += 
                    `<pre>${JSON.stringify(data, null, 2)}</pre>`;
            })
            .catch(error => {
                console.error('错误:', error);
                document.getElementById('result').innerHTML = 
                    `<p style="color: red;">API调用失败: ${error.message}</p>`;
            });
    </script>
</body>
</html>
